import classNames from "classnames";

import styles from './index.module.scss'

import { ReactNode } from 'react'

interface Props extends React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
    className?: string
    extra?: ReactNode
    errorMsg?: string
}


export default function Input({ className, extra, errorMsg, ...rest }: Props) {
    return (
        <div className={styles.root}>
            <input className='input' {...rest}></input>
            <div className='validate'>{errorMsg}</div>
            {extra ? <div className='extra'>{extra}</div> : null}
        </div>
    )
}